<template>
  <div class="bg">
    <div class="user-profile">
      <div class="user-avatar">
        <el-avatar :src="userInfo.headImgUrl" :size="100"></el-avatar>
      </div>
      <div class="flex-row">
        <span class="label">用户名：</span>
        <el-input v-model="userInfo.nickname" style="flex: 1"></el-input>
      </div>
      <div class="flex-row">
        <span class="label">手机：</span>
        <el-input v-model="userInfo.phone" style="flex: 1"></el-input>
      </div>
      <div class="flex-row">
        <span class="label">邮箱：</span>
        <el-input v-model="userInfo.email" style="flex: 1"></el-input>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "UserProfile",
  data() {
    return {
      userInfo: this.$store.state.userInfo
    }
  }
}
</script>

<style scoped lang="scss">
.bg{
    background: #1d86ff;
    width: 100%;
    height: 100%;
  position: relative;

}
.user-profile {
  top: 40px;
  position: relative;
  background: white;
  width: 800px;
  margin:0 auto;
  padding: 20px;
  box-shadow: 0 0 5px 1px rgba(0, 0, 0, 0.2);

  .flex-row {
    display: flex;
    align-items: center;

    .label {
      width: 80px;
      text-align: left;
    }

    margin-bottom: 20px;

    &:last-of-type {
      margin-bottom: 0;
    }
  }
}
</style>